---
sidebar_label: Enable telemetry gathering
description: >-
  Step-by-step guide to enabling telemetry gathering with OpenBao
---

# Enable OpenBao telemetry gathering

Collect telemetry data from your OpenBao installation.

## Before you start

- **You must have access to your [OpenBao configuration](/docs/configuration) file**.


## Step 1: Choose an aggregation agent

@include 'telemetry/supported-aggregation-agents.mdx'

## Step 2: Enable at least one audit device

To include audit-related metrics, you must enable auditing on at least one device
with the `bao audit enable` command. For example, to enable auditing for the
`file` device and save the logs to `/var/log/openbao_audit.log`:

```shell-session
$ bao audit enable file file_path=/var/log/openbao_audit.log
```

## Step 3: Configure telemetry collection

To configure telemetry collection, update the telemetry stanza in your OpenBao
configuration with your collection preferences and aggregation agent details.

For example, the following `telemetry` stanza configures OpenBao with the standard
telemetry defaults and connects it to a Statsite agent running on the default
port within a company intranet at `mycompany.statsite`:

```hcl
telemetry {
  usage_gauge_period = "10m"
  maximum_gauge_cardinality = 500
  disable_hostname = false
  enable_hostname_label = false
  lease_metrics_epsilon = "1h"
  num_lease_metrics_buckets = 168
  add_lease_metrics_namespace_labels = false
  filter_default = true

  statsite_address = "mycompany.statsite:8125"
}
```

Many metrics solutions charge by the metric. You can set `filter_default` to
false and use the `prefix_filter` parameter to include and exclude specific
values based on metric name to avoid paying for irrelevant information.

For example, to limit your telemetry to the core token metrics plus the number
of leases set to expire:

```hcl
telemetry {
  filter_default = false
  prefix_filter = ["+vault.token", "-vault.expire", "+vault.expire.num_leases"]
}
```

## Step 4: Choose a reporting solution

You need to save or forward your telemetry data to a separate storage solution
for reporting, analysis, and alerting. Which solution you need depends on the
feature set provided by your aggregation agent and the protocol support of your
reporting platform.

Popular reporting solutions compatible with OpenBao:

- [Grafana](https://grafana.com/grafana)
- [Graphite](https://www.hostedgraphite.com)
- [InfluxData: Telegraf](https://www.influxdata.com/time-series-platform/telegraf)
- [InfluxData: InfluxDB](https://www.influxdata.com/products/influxdb-overview)
- [InfluxData: Chronograf](https://www.influxdata.com/time-series-platform/telegraf)
- [InfluxData: Kapacitor](https://www.influxdata.com/time-series-platform/kapacitor)
- [Splunk](https://www.splunk.com)


## Next steps

- Review the full list of available
  [telemetry parameters](/docs/configuration/telemetry#telemetry-parameters).
